<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>宠物医院</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <link th:href="@{/img/pet2.jpg}" rel="shortcut icon">
</head>
<body>
<!--顶部导航栏-->
<div th:replace="~{comment/comment::topbar}"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边导航栏-->
        <div th:replace="~{comment/comment::sidebar(active='director/message.html')}"></div>
        <!--主视图-->
        <main role="main" class="col-md-9 ml-sm-auto col-lg-11 pt-3 px-4">
            <h2>邮件列表</h2>
            <div class="row">
                <div class="col-md-10 column">
                    <a class="btn btn-primary" th:href="@{/toSend}">写邮件</a>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <!--表头-->
                    <thead align="center">
                    <tr>
                        <th>邮件ID</th>
                        <th>主题</th>
                        <th>院长邮箱</th>
                        <th>用户名</th>
                        <th>用户邮箱</th>
                        <th>发送时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <!--表身-->
                    <tbody align="center">
                    <tr th:each="m:${messages}">
                        <td th:text="${m.getMid()}"></td>
                        <td th:text="${m.getSubject()}"></td>
                        <td th:text="${m.getSend()}"></td>
                        <td th:text="${m.getRecipients()}"></td>
                        <td th:text="${m.getReceive()}"></td>
                        <td th:text="${#dates.format(m.getMDate(),'yyyy-MM-dd HH:dd:ss')}"></td>
                        <td>
                            <a class="btn btn-primary" th:href="@{/deleteMessage/}+${m.getMid()}">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </main>
    </div>
</div>
</body>

</html>